<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org"
      xmlns:sec="http://www.thymeleaf.org/thymeleaf-extras-springsecurity3">
<head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8">
    <title>后台管理系统</title>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <meta name="keywords" content="后台管理系统">
    <meta name="description" content="">
    <link rel="shortcut icon" href="/img/favicon.ico">

    <link rel="stylesheet" href="/plugins/layui_v2/css/layui.css">
    <link rel="stylesheet" href="/css/global.css">

    <link rel="stylesheet" type="text/css" href="/css/common.css" media="all">
    <link rel="stylesheet" type="text/css" href="/css/personal.css" media="all">
    <link rel="stylesheet" type="text/css" href="http://at.alicdn.com/t/font_9h680jcse4620529.css">
    <script src="/plugins/layui_v2/layui.js"></script>


<body>
<div class="larry-grid layui-anim layui-anim-upbit larryTheme-A">
    <div class="larry-personal">
        <div class="layui-tab">
            <blockquote class="layui-elem-quote mylog-info-tit">
                <div class="layui-inline">
                    <form class="layui-form" id="roleSearchForm">
                        <div class="layui-input-inline" style="width:110px;">
                            <select name="searchTerm" >
                                <option value="name">用户名</option>
                            </select>
                        </div>
                        <div class="layui-input-inline" style="width:145px;">
                            <input type="text" name="searchContent" value="" placeholder="请输入关键字" class="layui-input search_input">
                        </div>
                        <a class="layui-btn roleSearchList_btn" lay-submit lay-filter="logSearchFilter"><i class="layui-icon larry-icon larry-chaxun7"></i>查询</a>
                    </form>
                </div>
            </blockquote>
            <div class="larry-separate"></div>
            <!-- 列表 -->
            <div class="layui-tab-item  layui-show" style="padding: 10px 15px;">
                <table id="logTableList" lay-filter="logTableId"></table>
            </div>

        </div>
    </div>
</div>
<script type="text/javascript" th:inline="javascript">
    layui.config({
        base : "/js/"
    }).use(['form', 'table', 'layer','common'], function () {
        var $ =  layui.$,
                form = layui.form,
                table = layui.table,
                layer = layui.layer,
                common = layui.common;

        var loading = layer.load(0,{ shade: [0.3,'#000']});

        /**表格加载*/
        table.render({
            elem: '#logTableList',
            url: '/sys/log/listAjax',
            id:'logTableId',
            method: 'get',
            height:'full-140',
            skin:'row',
            even:'true',
            size: 'sm',
            cols: [[
                {type:"numbers"},
                {type:"checkbox"},
                {field:'username', title: '用户名', align:'center', width: '8%'},
                {field:'operation', title: '用户操作',align:'center', width: '10%'},
                {field:'method', title: '操作方法',align:'center'},
                {field:'params', title: '参数',align:'center', width: '15%'},
                {field:'ip', title: 'IP',align:'center', width: '10%'},
                {field:'time', title: '执行时间(ms)',align:'center', width: '8%'},
                {field:'createTime', title: '创建时间',align:'center', width: '12%'}
            ]],
            page: true,
            done: function (res, curr, count) {
                common.resizeGrid();
                layer.close(loading);
            }
        });

        /**查询*/
        $(".roleSearchList_btn").click(function(){
            var loading = layer.load(0,{ shade: [0.3,'#000']});
            //监听提交
            form.on('submit(logSearchFilter)', function (data) {
                table.reload('logTableId',{
                    where: {
                        key:data.field.searchTerm,
                        value:data.field.searchContent
                    },
                    height: 'full-140',
                    page: true,
                    done: function (res, curr, count) {
                        common.resizeGrid();
                        layer.close(loading);

                    }
                });
            });

        });

    });

</script>
</body>
</html>